<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<c:set var="ctxPath" value="${pageContext.request.contextPath}" scope="page" />
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<base href="<%=basePath%>pages/khxt/">
<title>对 ${touser.fullname} 的评价</title>

<meta charset="UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<!-- 让 IE 浏览器运行最新的渲染模式 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- 让部分国产浏览器默认采用高速模式渲染页面 -->
<meta name="renderer" content="webkit">
<%-- <link type="text/css"
	href="<%=basePath%>/css/bootstrap/bootstrap.min.css" rel="stylesheet">
<script src="<%=basePath%>/css/bootstrap/jquery.min.js"></script>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="<%=basePath%>/css/bootstrap/bootstrap.min.js"></script> --%>
<script src="<%=basePath%>/css/bootstrap/jquery.min.js"></script>
<style>
.table-info td.rt {
	text-align: center;
}
</style>

</head>
<body>

	<form id="examine" action="<%=basePath%>/khxt/saveExamineExamineResult.do" method="post">
		<input type="hidden" value="${touser.userId}" name="userId">
		<input type="hidden" value="${e_oid}" name="examineId">
		<input type="hidden" value="${special}" name="special">
		
		<table class="table-info" cellpadding="0" cellspacing="1" width="100%">
			<tr>
				<th colspan="8"><h2>对 ${touser.fullname} 的评价</h2></th>
			</tr>

			<tr>
				<td colspan="1" style="width:4%" class="rt">序号</td>
				<td colspan="1" class="rt" style="width:40%">考核项</td>
				<td colspan="6" class="rt">详情</td>
			</tr>
		</table>

			<c:forEach items="${eis}" var="ei" varStatus="count">
			<table class="table-info" cellpadding="0" cellspacing="1" width="100%">
				
					<c:set var="jiaMaxScore" value="${ei.jiaMaxScore}" scope="page" />
					<c:set var="jianMaxScore" value="${ei.jianMaxScore}" scope="page" />
					<c:set var="jiaMinScore" value="${ei.jiaMinScore}" scope="page" />
					<c:set var="jianMinScore" value="${ei.jianMinScore}" scope="page" />
					<c:if test="${isKeJi==true}">
						<c:set var="score" value="${ei.kejiitemScore}" scope="page" />
					</c:if>
					<c:if test="${isKeJi==false}">
						<c:set var="score" value="${ei.kebanyuanitemScore}" scope="page" />
					</c:if>
					<%
						if(pageContext.getAttribute("score")==null){
							pageContext.setAttribute("score", 0.0);
						}
					%>
					<input type="hidden" value="${ei.oid}" name="eirs[${count.index}].item.oid">
					<tr id="ei_${ei.oid}_itemTxt">
						<td colspan="1" style="width:4%" class="rt" rowspan="5">${count.index+1}</td>
						<td colspan="1" style="width:40%">基础分：${ei.itemTxt}</td>
						<td colspan="4">
							<%
								//String scoreStr = (String)pageContext.getAttribute("score");
								//double score = Double.parseDouble(scoreStr);
								double score = ((Double)pageContext.getAttribute("score"));
								for(int i=0;i<=score;i++) {
								pageContext.setAttribute("s", i);
							%>
								<%
									if(score==0){
								%>
									<input type="hidden" name="eirs[${count.index}].itemVal" value="0">
								<%continue;} %>
								<input type="radio" name="eirs[${count.index}].itemVal" value="${pageScope.s}">${pageScope.s}分
							<% } %>
						</td>
					</tr>
					<tr id="ei_${ei.oid}_jiareason">
						<td colspan="1">加分项：${ei.jiaReason}</td>
							<td colspan="4">
								<%
									double jiaMaxScore = ((Double)pageContext.getAttribute("jiaMaxScore"));
									for(int i=0;i<=jiaMaxScore;i++) {
										pageContext.setAttribute("plus", i);
								%>
									<input type="radio" name="eirs[${count.index}].jiaScore" value="${pageScope.plus}">${pageScope.plus}分
								<% } %>
							</td>
					</tr>
					<tr id="ei_${ei.oid}_jianScore">
						<td colspan="1">减分项：${ei.jianReason}</td>
						<td colspan="4">
							<%
								double jianMaxScore = 0.0;
								double jianMinScore = 0.0;
								if(pageContext.getAttribute("jianMaxScore")!=null && !"".equals(pageContext.getAttribute("jianMaxScore"))){
									jianMaxScore = ((Double)pageContext.getAttribute("jianMaxScore"));
								}
								if(pageContext.getAttribute("jianMinScore")!=null && !"".equals(pageContext.getAttribute("jianMinScore"))){
									jianMinScore = ((Double)pageContext.getAttribute("jianMinScore"));
								}
							%>
								<c:if test="${jianMaxScore!=null&&jianMinScore>0}">
									<input type="radio" name="eirs[${count.index}].jianScore" value="0">0分
								</c:if>
							<%
								for(int i=(int)jianMinScore;i<=jianMaxScore;i++) {
									pageContext.setAttribute("div_", i);
							%>
								<input type="radio" name="eirs[${count.index}].jianScore" value="${pageScope.div_}">-${pageScope.div_}分								
							<% } %>
							
								<c:if test="${jianMaxScore==null}">
									<input type="hidden" name="eirs[${count.index}].jianScore" value="0">
								</c:if>
							
						</td>
					</tr>
			</table>
			</c:forEach>
				
				<c:if test="${special==1}">
				
					<table class="table-info" cellpadding="0" cellspacing="1" width="100%">
						<tr>
							<th colspan="8"><h2>特殊考核指标</h2></th>
						</tr>
			
						<tr>
							<td colspan="1" style="width:4%" class="rt">序号</td>
							<td colspan="1" class="rt" style="width:40%">考核项</td>
							<td colspan="6" class="rt">详情</td>
						</tr>
					</table>
				
					<c:forEach items="${eiss}" var="ei" varStatus="count">
					<table class="table-info" cellpadding="0" cellspacing="1" width="100%">
							<c:set var="jiaMaxScore" value="${ei.jiaMaxScore}" scope="page" />
							<c:set var="jianMaxScore" value="${ei.jianMaxScore}" scope="page" />
							<c:set var="jiaMinScore" value="${ei.jiaMinScore}" scope="page" />
							<c:set var="jianMinScore" value="${ei.jianMinScore}" scope="page" />
							<c:if test="${isKeJi==true}">
								<c:set var="score" value="${ei.kejiitemScore}" scope="page" />
							</c:if>
							<c:if test="${isKeJi==false}">
								<c:set var="score" value="${ei.kebanyuanitemScore}" scope="page" />
							</c:if>
							<%
								if(pageContext.getAttribute("score")==null){
									pageContext.setAttribute("score", 0.0);
								}
							%>
							
							<input type="hidden" value="${ei.oid}" name="specialRirs[${count.index}].item.oid">
							<tr id="ei_${ei.oid}_itemTxt">
								<td colspan="1" style="width:4%" class="rt" rowspan="5">${count.index+1}</td>
								<td colspan="1" style="width:40%">基础分：${ei.itemTxt}</td>
								<td colspan="4">
									<%
										//String scoreStr = (String)pageContext.getAttribute("score");
										//double score = Double.parseDouble(scoreStr);
										double score = ((Double)pageContext.getAttribute("score"));
										for(int i=0;i<=score;i++) {
										pageContext.setAttribute("s", i);
									%>
										<%
											if(score==0) {
										%>
											<input type="hidden" name="specialRirs[${count.index}].itemVal" value="0">
										<% continue;} %>
										<input type="radio" name="specialRirs[${count.index}].itemVal" value="${pageScope.s}">${pageScope.s}分
									<% } %>
								</td>
							</tr>
							<tr id="ei_${ei.oid}_jiareason">
								<td colspan="1">加分项：${ei.jiaReason}</td>
									<td colspan="4">
										<%
											double jiaMaxScore = ((Double)pageContext.getAttribute("jiaMaxScore"));
											for(int i=0;i<=jiaMaxScore;i++) {
												pageContext.setAttribute("plus", i);
										%>
											<input type="radio" name="specialRirs[${count.index}].jiaScore" value="${pageScope.plus}">${pageScope.plus}分
										<% } %>
									</td>
							</tr>
							<tr id="ei_${ei.oid}_jianScore">
								<td colspan="1">减分项：${ei.jianReason}</td>
								<td colspan="4">
									<%
										double jianMaxScore = 0.0;
										double jianMinScore = 0.0;
										if(pageContext.getAttribute("jianMaxScore")!=null && !"".equals(pageContext.getAttribute("jianMaxScore"))){
											jianMaxScore = ((Double)pageContext.getAttribute("jianMaxScore"));
										}
										if(pageContext.getAttribute("jianMinScore")!=null && !"".equals(pageContext.getAttribute("jianMinScore"))){
											jianMinScore = ((Double)pageContext.getAttribute("jianMinScore"));
										}
									%>
									<c:if test="${jianMaxScore!=null&&jianMinScore>0}">
										<input type="radio" name="specialRirs[${count.index}].jianScore" value="0">0分
									</c:if>
									<%
										for(int i=(int)jianMinScore;i<=jianMaxScore;i++) {
											pageContext.setAttribute("div_", i);
									%>
										<input type="radio" name="specialRirs[${count.index}].jianScore" value="${pageScope.div_}">-${pageScope.div_}分								
									<% } %>
									
										<c:if test="${jianMaxScore==null}">
											<input type="hidden" name="specialRirs[${count.index}].jianScore" value="0">
										</c:if>
									
								</td>
							</tr>
					</table>
					</c:forEach>
				</c:if>
					
				<c:if test="${special==1}">
				
					<table class="table-info" cellpadding="0" cellspacing="1" width="100%">
						<tr>
							<th colspan="8"><h2>非分值型特殊考核指标</h2></th>
						</tr>
			
						<tr>
							<td colspan="1" style="width:4%" class="rt">序号</td>
							<td colspan="1" class="rt" style="width:40%">考核项</td>
							<td colspan="6" class="rt">详情</td>
						</tr>
					</table>
				
					<table class="table-info" cellpadding="0" cellspacing="1" width="100%">
							<input type="hidden" value="${eiss2[0].oid}" name="specialRirs2[0].item.oid">
							<tr id="ei_${eiss2[0].oid}_itemTxt">
								<td colspan="1" style="width:4%" class="rt" rowspan="5">${0+1}</td>
								<td colspan="1" style="width:40%">${eiss2[0].itemTxt}</td>
								<td colspan="4">
									<input type="radio" name="specialRirs2[0].itemVal" value="1">${eiss2[0].specialResult}
									<input type="radio" name="specialRirs2[0].itemVal" value="0">无
								</td>
							</tr>
					</table>
					<table class="table-info" cellpadding="0" cellspacing="1" width="100%">
							<input type="hidden" value="${eiss2[1].oid}" name="specialRirs2[1].item.oid">
							<tr id="ei_${eiss2[1].oid}_itemTxt">
								<td colspan="1" style="width:4%" class="rt" rowspan="5">${1+1}</td>
								<td colspan="1" style="width:40%">${eiss2[1].itemTxt}</td>
								<td colspan="4">
									<input type="radio" name="specialRirs2[1].itemVal" value="1">${eiss2[1].specialResult}
									<input type="radio" name="specialRirs2[1].itemVal" value="0">无
								</td>
							</tr>
					</table>
				</c:if>
	</form>
</body>
</html>
